Bayesian Detection of a Change in a Random Sequence with Unknown Initial and Final Distributions