As it headed toward bankruptcy, Diamond Offshore Drilling Inc. took advantage of a little-noticed provision in the stimulus bill Congress passed in March to get a $9.7 million tax refund. Then, it asked a bankruptcy judge to authorize the same amount as bonuses to nine executives.