A man who was found in possession of drugs after leaving Lisburn Magistrates Court has been sentenced to six months in prison.