An ab initio investigation of HC4NC and C5NH: two candidate molecules for interstellar detection