title: EXC_BAD_ACCESS "attempted to retain deallocated object" in `deinit`
body: <p>The following code-snippet fails in <code>deinit</code> with an EXC_BAD_ACCESS and previously with an EXC_BREAKPOINT in method <code>_swift_abortRetainUnowned</code> with a message "<strong>attempted to retain deallocated object</strong>".</p>
  
  <p>I'm wondering <em>why</em> the imported <code>self</code> will be retained when it is captured as <code>unowned</code> - and even though the closure is declared explicitly as <code>@noescape</code>. IMHO, self shouldn't be retained here when imported into the closure.</p>
  
  <p>In contrast, when <code>self</code> will be captured as a <em>strong</em> reference, the code succeeds. I would understand it if it were the other way around. What I'm missing?</p>
  
  <pre><code>import Foundation
  
  public class Bar {
  
      private let _id = 1
  
      func foo(@noescape f: ()-&gt;()) -&gt; () {
          f()
      }
  
      deinit {
          foo() { [unowned self] in
              let id = self._id
          }
      }    
  }
  
  
  
  func test() -&gt;() {
      var cr = Bar()
  }        
  test()
  </code></pre>
  
  <p>Stack:</p>
  
  <pre><code>UnownedSelf`_swift_abortRetainUnowned:
      0x100174d90 &lt;+0&gt;:  leaq   0x1979d(%rip), %rax       ; "attempted to retain deallocated object"
      0x100174d97 &lt;+7&gt;:  movq   %rax, 0x65ff2(%rip)       ; gCRAnnotations + 8
      0x100174d9e &lt;+14&gt;: int3   
  -&gt;  0x100174d9f &lt;+15&gt;: nop    
  </code></pre>