A man who punched and threatened to shoot staff at the Royal Victoria Hospital in Belfast has been jailed for four months.