1.The answer to your specific question can be found in the Wikipedia page:

http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval

Basically, as stated in the question, one associates a confidence interval to an estimate a distribution parameter. The interval size is a function of the percentile which was required to be 50% in the question. The estimated value p* = k/n is inside the interval but the interval is not symmetric in general around this value. In the Wikipedia page, several approximations for large n, based on the central limit theorem, which are usually used in real-life estimations.

2.The above solution assumes prior knowledge that the distribution is binomial. Usually, one needs some prior knowledge to infere a statistical parameter. Specifically in your question, when the distrbution is not binomial, prior knowldge would be that the coin flips are independent, or that at after some flip the proportion coefficient p had changed, etc.