Improve cleanup of GPIO