M-theory potential from the G2 Hitchin functional in superspace