A redundant historic lever-frame signal box on the Portsmouth Direct Line has been handed over to a charity for preservation.