Plans to convert a derelict pub in Northampton into a dental practice and flats have been given the go-ahead by the council.