Loschmidt amplitude and work distribution in quenches of the sine-Gordon model