I think the safest way would be to have the pilot set the brakes, then disconnect the towbar from the tug, and then disconnect the towbar from the plane. Now, with that said. Keeping the towbar hooked to the tug is perfectly fine as long as the towbar has a jack on it to keep the bar from falling on someones toes or hitting the nose wheels when disconnected, also if the tug is inline with the towbar and can pull the bar straight off the plane, thats ok, but if the tractor is cocked one way or the other to the tow bar, disconnect the bar from from the tug before trying to pull the bar off the nosewheel.
this is my humble opinion derived from being a lineboy, mechanic and flight crewmember.
Good luck, don't make a mountain out of a molehill