An algorithm for stellarator coil optimization that takes engineering tolerances into account