Bristol City defender Mark Wilson has been handed an extended contract until the end of the season at Ashton Gate.