Release of backpacker during visit to Moscow caps a rollercoaster 5 days in which PM's diplomatic feats starred alongside his legal woes